﻿
#include <stddef.h>
#include <vector>
#include "n2types.h"

#ifndef UNIVER_TAB_H_79767ADA4DFE8EFA
#define UNIVER_TAB_H_79767ADA4DFE8EFA   1

class UniverTabItem
{
public:
    virtual void moveFrom(UniverTabItem *p) = 0;
    virtual void copyFrom(const UniverTabItem *p) = 0;
    virtual UniverTabItem * getOffsetItem(size_t index) = 0;
    virtual ~UniverTabItem();
};


class UniverTab
{
protected:
    size_t                      m_groupCubage;
    size_t                      m_allocTotal;
    size_t                      m_itemTotal;
    std::vector<UniverTabItem*> m_groups;

    void increaseGroupAlloc();
    virtual UniverTabItem* allocGroupData(size_t count) = 0;

public:
    UniverTab(size_t  cubage);
    virtual ~UniverTab();

    size_t moveItemInto(UniverTabItem & item);
    size_t moveItemInto(UniverTabItem * pItem);
    size_t copyItemInto(const UniverTabItem & item);
    size_t copyItemInto(const UniverTabItem * pItem);
    UniverTabItem* getItem(size_t index);
    size_t getTotalCount(void);
};










#endif
